;;;; Created on 2011-04-28 14:26:42
;13.8

;b
(defun new-histogram (x)
  (setf *HIST-ARRAY* (make-array x :initial-element 0))
  (setf *TOTAL-POINTS* 0)
  T
  )

;c
(defun record-value (x)
  (if (and (>= x 0) (<= x (length *HIST-ARRAY*)))
    (and (incf (aref *HIST-ARRAY* x)) (incf *TOTAL-POINTS*))
      "out of range!"
    )
  )

;d
(defun print-hist-line (x)
  (print (list x '[ (aref *HIST-ARRAY* x) ']))
  )

;e
(defun PRINT-HISTOGRAM ()
  (DOTIMES (x (length *HIST-ARRAY*) nil)
           (print-hist-line  x)
           )
  )
